package cloud.daodao.storm.common.dict.error;

import cloud.daodao.storm.common.constant.ServiceCode;
import cloud.daodao.storm.common.error.ErrorEnum;
import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @author DaoDao
 */
@Getter
@AllArgsConstructor
public enum DictError implements ErrorEnum {

    ERROR(code("001"), "dict 服务异常"),

    CODE_MAP_NOT_EXIST(code("112"), "代码映射记录不存在"),
    CODE_MAP_ALREADY_EXIST(code("113"), "代码映射记录已存在"),

    ;

    /**
     * 错误编码
     */
    public final String code;

    /**
     * 错误信息
     */
    public final String message;

    private static String code(String code) {
        return ServiceCode.DICT + code;
    }

}
